import request from "@/utils/request";

export const getBannersAPI = (distributionSite = 1) => {
  return request({
    url: '/home/banner', data: {
      distributionSite
    }
  })
};

export const getCategoryAPI = () => {
  return request({
    url: "/home/category/mutli",
  });
};

export const getHotsAPI = () => {
  return request({
    url: "/home/hot/mutli",
  });
};

export const getNewGoodsAPI = (limit = 4) => {
  return request({
    url: "/home/new",
    params: { limit },
  });
};

export const getLikesAPI = (page = 1, pageSize = 10) => {
  return request({
    url: "/home/goods/guessLike",
    data: { page, pageSize },
  });
};

// 1.改造API， 支持传参page 💥 记得处理undefined的问题
export const getRecommendAPI = (url, subType = "", page = 1) => {
  return request({
    url,
    data: {
      subType,
      page
    }
  })
};
